package com.learn.sunday.stock;

import com.learn.sunday.common.service.RegisterService;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.client.RestTemplate;

@Slf4j
@SpringBootApplication
@EnableScheduling
@EnableDiscoveryClient
@MapperScan("com.learn.sunday.stock.mapper")
public class StockApplication {

    @Bean
    public RestTemplate restTemplate()
    {
        return new RestTemplate();
    }
    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(StockApplication.class, args);
        String name = applicationContext.getEnvironment().getProperty("user.name");
        String age = applicationContext.getEnvironment().getProperty("user.age");
        log.info("name={}，age={}",name,age);
        log.info(applicationContext.getEnvironment().toString());
        log.info(RegisterService.class + "test");
    }
}